// pages/leftSwiperDel/index.js
// pages/order/order.js
Page({
  /* 页面的初始数据 */
  data: {
    currtab: 0,  
    cancelable: true,
    swipertab: [
      { name: '全部', index: 0 },
      { name: '待支付', index: 1 },
      { name: '待发货', index: 2 },
      { name: '待收货', index: 3 },
      { name: '已完成', index: 4 }
    ],
    allShow: [
      {
        name: "沃链商城111",
        state: "待支付",
        state2: 2,
        url: "./img/xy.jpg",
        money: "132"
      },
      {
        name: "沃链商城16161666",
        state: "交易关闭",
        state2: 6,
        url: "./img/xy.jpg",
        money: "66666"
      },
      {
        name: "沃链商城33333",
        state: "待支付",
        state2: 2,
        url: "./img/xy.jpg",
        money: "132"
      },
      {
        name: "沃链商城444444",
        state: "待发货",
        state2: 3,
        url: "./img/xy.jpg",
        money: "205"
      },
      {
        name: "沃链商城555555",
        state: "待支付",
        state2: 2,
        url: "./img/xy.jpg",
        money: "132"
      },
      {
        name: "沃链商城66666",
        state: "待发货",
        state2: 3,
        url: "./img/xy.jpg",
        money: "205"
      },
      {
        name: "沃链商城777777",
        state: "待支付",
        state2: 2,
        url: "./img/xy.jpg",
        money: "132"
      },
      {
        name: "沃链商城88888888",
        state: "待发货",
        state2: 3,
        url: "./img/xy.jpg",
        money: "205"
      },
      {
        name: "沃链商城9999999",
        state: "待支付",
        state2: 2,
        url: "./img/xy.jpg",
        money: "132"
      },
      {
        name: "沃链商城10101010",
        state: "待发货",
        state2: 3,
        url: "./img/xy.jpg",
        money: "205"
      },
      {
        name: "沃链商城9999999",
        state: "已完成",
        state2: 5,
        url: "./img/xy.jpg",
        money: "132"
      },
      {
        name: "沃链商城10101010",
        state: "待收货",
        state2: 4,
        url: "./img/xy.jpg",
        money: "205"
      },
      {
        name: "沃链商城9999999",
        state: "待收货",
        state2: 4,
        url: "./img/xy.jpg",
        money: "132"
      },
      {
        name: "沃链商城10101010",
        state: "已完成",
        state2: 5,
        url: "./img/xy.jpg",
        money: "205"
      },
      {
        name: "跃动体育运动俱乐部(圆明园店)",
        state: "待发货",
        state2: 3,
        url: "./img/xy.jpg",
        money: "205"
      },
    ]
  },
  stop: function () { console.log("阻止事件冒泡") },
  back2: function () {
    wx.switchTab({
        url: '/pages/my/my',
        success: function (res) {
          console.log("跳转成功:" + res)
        },
        fail: function (res) {
          console.log("跳转失败" + res)
        }
      })
  },
  //跳转路由
  inOrderdetails: function () {
    wx.navigateTo({
      url: "/pages/Order-details/Order-details"
    })
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {
    // 页面渲染完成
    this.getDeviceInfo()
  },
  getDeviceInfo: function () {
    let that = this
    wx.getSystemInfo({
      success: function (res) {
        var clientHeight = res.windowHeight,
          clientWidth = res.windowWidth,
          rpxR = 750 / clientWidth;
        var calc = clientHeight * rpxR;
        console.log(calc)
        that.setData({
          winHeight: calc,
        })
      }
    })
  },
  /**
  * @Explain：选项卡点击切换
  */
  tabSwitch: function (e) {
    var that = this
    if (this.data.currtab === e.target.dataset.current) {
      return false
    } else {
      that.setData({
        currtab: e.target.dataset.current,
        cancelable: false
      })
    }
  },
  tabChange: function (e) {
    this.setData({ currtab: e.detail.current})
  }
})